package com.oracle.oa.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity                        
@Table(name="roleinfo")
public class Roleinfo  implements java.io.Serializable {


	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "roleid", unique = true, nullable = false)      
     private int roleid;
	 
	 @Column(name = "rolename")
     private String rolename;
	 
	 @Column(name = "roledesc")
     private String roledesc;
	 
	 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
     private Set userinfos = new HashSet(0);
	public int getRoleid() {
		return roleid;
	}
	public void setRoleid(int roleid) {
		this.roleid = roleid;
	}
	public String getRolename() {
		return rolename;
	}
	public void setRolename(String rolename) {
		this.rolename = rolename;
	}
	public String getRoledesc() {
		return roledesc;
	}
	public void setRoledesc(String roledesc) {
		this.roledesc = roledesc;
	}
	public Set getUserinfos() {
		return userinfos;
	}
	public void setUserinfos(Set userinfos) {
		this.userinfos = userinfos;
	}
	public Roleinfo() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Roleinfo(int roleid, String rolename, String roledesc, Set userinfos) {
		this.roleid = roleid;
		this.rolename = rolename;
		this.roledesc = roledesc;
		this.userinfos = userinfos;
	}
	@Override
	public String toString() {
		return "Roleinfo [roleid=" + roleid + ", rolename=" + rolename
				+ ", roledesc=" + roledesc + ", userinfos=" + userinfos + "]";
	}


}